package com.fjnldx.ks.controller;

import com.fjnldx.ks.pojo.domain.Dev;
import com.fjnldx.ks.pojo.request.*;
import com.fjnldx.ks.pojo.response.DevSnAreaList;
import com.fjnldx.ks.pojo.response.Result;
import com.fjnldx.ks.pojo.response.TxcsomlResult;
import com.fjnldx.ks.service.MesThirdService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


/**
 * @author 11759
 */
@RestController
@RequestMapping("/api-screen")
@Api(value = "数据大屏模块", tags = "数据大屏")
public class ThirdController {
    @Resource
    MesThirdService mesThirdService;

    @PostMapping("/getNewestBingTiao")
    @ApiOperation(value = "并条实时数据查询接口", notes = "Api")
    public Result mesFc6(@ApiParam(value = "入参JSON") @RequestBody Dev devSn) {
        return mesThirdService.getNewestBingTiao(devSn);
    }

    @PostMapping("/getNewestShuMianji")
    @ApiOperation(value = "梳棉机2017实时数据查询接口", notes = "Api")
    public Result mesFc11(@ApiParam(value = "入参JSON") @RequestBody Dev devSn) {
        return mesThirdService.getNewestShuMianJi(devSn);
    }

    @PostMapping("/getNewestShuMianjiA")
    @ApiOperation(value = "梳棉机2017A实时数据查询接口", notes = "Api")
    public Result mesFc12(@ApiParam(value = "入参JSON") @RequestBody Dev devSn) {
        return mesThirdService.getNewestShumianjiaTable(devSn);
    }

    @PostMapping("/getNewestXiShaMzl")
    @ApiOperation(value = "细纱马佐里实时数据查询接口", notes = "Api")
    public Result mesFc5(@ApiParam(value = "入参JSON") @RequestBody Dev devSn) throws Exception {
        return mesThirdService.getNewestXiShaMzl(devSn);
    }

    @PostMapping("/workshopOpeningRatioRing")
    @ApiOperation(value = "车间开台比例-圆环", notes = "车间开台比例-圆环")
    public Result workshopOpeningRatioRing() {
        return mesThirdService.workshopOpeningRatioRing();
    }

    @PostMapping("/workshopOpeningRatiBarChart")
    @ApiOperation(value = "车间开台比例-条形图", notes = "车间开台比例-条形图")
    public Result workshopOpeningRatiBarChart() throws Exception {
        return mesThirdService.workshopOpeningRatiBarChart();
    }

    @PostMapping("/getNewestLuoTong")
    @ApiOperation(value = "络筒实时数据查询接口", notes = "Api")
    public Result mesFc17(@ApiParam(value = "入参JSON") @RequestBody Dev devSn) {
        return mesThirdService.getNewestLuoTong(devSn);
    }

    @PostMapping("/getNewestTxcsoml")
    @ApiOperation(value = "太行粗纱欧姆龙实时数据查询接口", notes = "Api")
    public Result mesFc7(@ApiParam(value = "入参JSON") @RequestBody Dev devSn) {
        return mesThirdService.getNewestTxcsoml(devSn);
    }

    @PostMapping("/getNewestTxcsomlNew")
    @ApiOperation(value = "太行粗纱欧姆龙实时数据查询接口-新设备", notes = "Api")
    public Result getNewestTxcsomlNew(@ApiParam(value = "入参JSON") @RequestBody Dev devSn) {
        return mesThirdService.getNewestTxcsomlNew(devSn);
    }

    @PostMapping("/getNewestJingKaiMianJi")
    @ApiOperation(value = "精开棉机实时数据查询接口", notes = "Api")
    public Result mesFc14(@ApiParam(value = "入参JSON") @RequestBody Dev devSn) {
        return mesThirdService.getNewestJingKaiMianJi(devSn);
    }

    @PostMapping("/getNewestDuoCan")
    @ApiOperation(value = "多仓实时数据查询接口", notes = "Api")
    public Result mesFc15(@ApiParam(value = "入参JSON") @RequestBody Dev devSn) {
        return mesThirdService.getNewestDuoCan(devSn);
    }

    @PostMapping("/getNewestZmj")
    @ApiOperation(value = "抓棉机实时数据查询接口", notes = "Api")
    public Result mesFc16(@ApiParam(value = "入参JSON") @RequestBody Dev devSn) {
        return mesThirdService.getNewestZmj(devSn);
    }

    @PostMapping("/getGroupXiSha")
    @ApiOperation(value = "获取细纱分组数据", notes = "Api")
    public Result mesFc8() throws Exception {
        return mesThirdService.getGroupXiSha();
    }

    @PostMapping("/getGroupNewestXiSha")
    @ApiOperation(value = "查询细纱1.5级车间", notes = "Api")
    public Result mesFc8(@RequestBody XsReq xsReq) {
        return mesThirdService.getGroupNewestXiSha(xsReq);
    }

    @PostMapping("/getGroupZmj")
    @ApiOperation(value = "获取抓棉机分组数据", notes = "Api")
    public Result mesFc20() {
        return mesThirdService.getGroupZmj();
    }

    @PostMapping("/getGroupJingKaiMianJi")
    @ApiOperation(value = "获取精开棉机分组数据", notes = "Api")
    public Result mesFc16() {
        return mesThirdService.getGroupJingKaiMianJi();
    }

    @PostMapping("/getGroupDianBiao")
    @ApiOperation(value = "获取电表分组数据", notes = "Api")
    public Result mesFc19() {
        return mesThirdService.getGroupDianBiao();
    }

    @PostMapping("/getGroupLuoTong")
    @ApiOperation(value = "获取络筒分组数据", notes = "Api")
    public Result mesFc18() {
        return mesThirdService.getGroupLuoTong();
    }

    @PostMapping("/getGroupDuoCan")
    @ApiOperation(value = "获取多仓分组数据", notes = "Api")
    public Result mesFc17() {
        return mesThirdService.getGroupDuoCan();
    }

    @PostMapping("/getGroupTxcsoml")
    @ApiOperation(value = "获取太行粗纱欧姆龙分组数据", notes = "Api")
    public Result mesFc9() throws Exception {
        return mesThirdService.getGroupTxcsoml();
    }

    @PostMapping("/getGroupBingTiao")
    @ApiOperation(value = "获取并条分组数据", notes = "Api")
    public Result mesFc10() {
        return mesThirdService.getGroupBingTiao();
    }

    @PostMapping("/getGroupShuMianJi")
    @ApiOperation(value = "获取梳棉机分组数据{data1:梳棉机1207，data2：梳棉机1207A}", notes = "Api")
    public TxcsomlResult mesFc12() {
        return mesThirdService.getGroupShuMianJi();
    }

    //@PostMapping("/getHuiZongLuoTong")
    //@ApiOperation(value = "获取络筒汇总数据", notes = "Api")
    //public Result mesFc13(@RequestBody Dev dev) throws Exception {
    //    return mesThirdService.getHuiZongLuoTong(dev);
    //}

    @PostMapping("/getDlg")
    @ApiOperation(value = "获取动力柜数据", notes = "Api")
    public Result mesFc21(@RequestBody List<DlgReq> list) {
        return mesThirdService.getDlg(list);
    }

    @PostMapping("/cjyg")
    @ApiOperation(value = "车间用工数据", notes = "Api")
    public Result mesFc22() {
        return mesThirdService.getCjyg();
    }

    @PostMapping("/getXiShaClPzs")
    @ApiOperation(value = "获取细纱各品种产量", notes = "Api")
    public Result mesFc23() {
        return mesThirdService.queryXsYieldVariety();
    }

    @PostMapping("/querySpoolingYieldVariety")
    @ApiOperation(value = "自络各品种产量", notes = "自络各品种产量")
    public Result querySpoolingYieldVariety() {
        return mesThirdService.querySpoolingYieldVariety();
    }

    @PostMapping("/queryWenShiDu")
    @ApiOperation(value = "获取温湿度数据（isNow必传：获取当前实时数据，isNow:true）", notes = "isNow必传：获取当前实时数据，isNow:true")
    public Result mesFc24(@RequestBody TimeReq timeReq) {
        return mesThirdService.queryWenShiDu(timeReq);
    }

    @PostMapping("/getImpEpDian")
    @ApiOperation(value = "查询各工序电量", notes = "查询各工序电量")
    public Result mesFc25() throws Exception {
        return mesThirdService.getImpEpDian();
    }

    @PostMapping("/getYlByPointInTime")
    @ApiOperation(value = "获取时间点上压力机的压力", notes = "Api")
    public Result mesFc29(@RequestBody YlByPointInTimeReq pointInTimeReq) {
        return mesThirdService.getYlByPointInTime(pointInTimeReq);
    }

    @PostMapping("/getDlByDevSn")
    @ApiOperation(value = "获取设备的电流", notes = "Api")
    public Result mesFc27(@RequestBody DlByDevSnReq devSn) {
        return mesThirdService.getDlByDevSnReq(devSn);
    }

    @PostMapping("/getLatelyDlByDevSn")
    @ApiOperation(value = "获取所有设备的最近一次的电流", notes = "Api")
    public Result mesFc28() {
        return mesThirdService.getLatelyDlByDevSnReq();
    }

    @PostMapping("/getGroupNewestCusha")
    @ApiOperation(value = "查询粗纱1.5级车间", notes = "查询粗纱1.5级车间")
    public Result mesFc26(@RequestBody XsReq xsReq) {
        return mesThirdService.getGroupNewestCusha(xsReq);
    }

    @PostMapping("/getGroupNewestLuoTong")
    @ApiOperation(value = "查询络筒1.5级车间", notes = "查询络筒1.5级车间")
    public Result mesFc27(@RequestBody XsReq xsReq) {
        return mesThirdService.getGroupNewestLuoTong(xsReq);
    }

    @PostMapping("/getGroupNewestBingTiao")
    @ApiOperation(value = "查询并条1.5级车间", notes = "查询并条1.5级车间")
    public Result mesFc31(@RequestBody XsReq xsReq) {
        return mesThirdService.getGroupNewestBingTiao(xsReq);
    }

    @PostMapping("/getGroupNewestShuMian")
    @ApiOperation(value = "查询梳棉1.5级车间", notes = "查询梳棉1.5级车间")
    public Result mesFc32(@RequestBody XsReq xsReq) throws Exception {
        return mesThirdService.getGroupNewestShuMian(xsReq);
    }

    @PostMapping("/getGroupNewestQingHua")
    @ApiOperation(value = "查询清花1.5级车间", notes = "查询清花1.5级车间")
    public Result mesFc33(@RequestBody XsReq xsReq) {
        return mesThirdService.getGroupNewestQingHua(xsReq);
    }

    @PostMapping("/queryGongXuYg")
    @ApiOperation(value = "查询各工序用工数据", notes = "查询各工序用工数据")
    public Result mesFc34(@RequestBody Gx gx) {
        return mesThirdService.queryXiShaYg(gx);
    }

    @PostMapping("/getHistoryTrackData")
    @ApiOperation(value = "历史轨迹实时数据", notes = "Api")
    public Result mesFc35(@RequestBody DateSectionReq dateSectionReq) {
        return mesThirdService.getHistoryTrackData(dateSectionReq);
    }

    @PostMapping("/EachProcedureYield")
    @ApiOperation(value = "当前各工序产量", notes = "当前各工序产量")
    public Result eachProcedureYield() {
        return mesThirdService.EachProcedureYield();
    }

    @PostMapping("/workers/queryUseWorkersDetails")
    @ApiOperation(value = "查询细纱1.5用工数据", notes = "查询细纱1.5用工数据")
    public Result mesFc31() throws Exception {
        return mesThirdService.queryUseWorkersDetails();
    }

    @PostMapping("/queryXiShaDefiniteAndDetailed")
    @ApiOperation(value = "查询细纱1.5明细数据", notes = "查询细纱1.5明细数据")
    public Result queryXiShaDefiniteAndDetailed() {
        return mesThirdService.queryXiShaDefiniteAndDetailed();
    }

    @PostMapping("/queryDefiniteAndDetailedCs")
    @ApiOperation(value = "查询粗纱1.5明细数据", notes = "查询粗纱1.5明细数据")
    public Result queryDefiniteAndDetailedCs() {
        return mesThirdService.queryDefiniteAndDetailedCs();
    }

    @PostMapping("/queryDefiniteAndDetailedSm")
    @ApiOperation(value = "查询梳棉1.5明细数据", notes = "查询梳棉1.5明细数据")
    public Result queryDefiniteAndDetailedSm() {
        return mesThirdService.queryDefiniteAndDetailedSm();
    }

    @PostMapping("/queryDefiniteAndDetailedBt")
    @ApiOperation(value = "查询并条1.5明细数据", notes = "查询并条1.5明细数据")
    public Result queryDefiniteAndDetailedBt() {
        return mesThirdService.queryDefiniteAndDetailedBt();
    }

    @PostMapping("/queryDefiniteAndDetailedLt")
    @ApiOperation(value = "查询络筒1.5明细数据", notes = "查询络筒1.5明细数据")
    public Result queryDefiniteAndDetailedLt() {
        return mesThirdService.queryDefiniteAndDetailedLt();
    }

    @PostMapping("/getLineChartData")
    @ApiOperation(value = "获取细纱1.5级折线图数据", notes = "获取细纱1.5级折线图数据")
    public Result getLineChartData(@RequestBody DevSnAreaList data) {
        return mesThirdService.getLineChartData(data.getDevSn());
    }

    @PostMapping("/queryUseWorkersDetailsSummary")
    @ApiOperation(value = "获取细纱1.5级用工汇总数据", notes = "获取细纱1.5级用工汇总数据")
    public Result queryUseWorkersDetailsSummary() throws Exception {
        return mesThirdService.queryUseWorkersDetailsSummary();
    }

    @PostMapping("/getDailySalaryOfLs")
    @ApiOperation(value = "获取落纱工工资", notes = "获取落纱工工资")
    public Result getDailySalaryOfLs(@RequestBody DailySalary data) {
        return mesThirdService.getDailySalaryOfLs(data);
    }

    @PostMapping("/RunningState")
    @ApiOperation(value = "各工序车台运行状态统计", notes = "各工序车台运行状态统计")
    public Result runningState() {
        return mesThirdService.runningState();
    }

    @PostMapping("/employmentSummaryCs")
    @ApiOperation(value = "粗纱1.5用工汇总数据", notes = "粗纱1.5用工汇总数据")
    public Result employmentSummaryCs() {
        return mesThirdService.employmentSummaryCs();
    }

    @PostMapping("/employmentSummaryLt")
    @ApiOperation(value = "络筒1.5用工汇总数据", notes = "络筒1.5用工汇总数据")
    public Result employmentSummaryLt() {
        return mesThirdService.employmentSummaryLt();
    }

    @PostMapping("/employmentSummarySm")
    @ApiOperation(value = "梳棉1.5用工汇总数据", notes = "梳棉1.5用工汇总数据")
    public Result employmentSummarySm() {
        return mesThirdService.employmentSummarySm();
    }

    @PostMapping("/employmentSummaryBt")
    @ApiOperation(value = "并条1.5用工汇总数据", notes = "并条1.5用工汇总数据")
    public Result employmentSummaryBt() {
        return mesThirdService.employmentSummaryBt();
    }
}
